
package com.jf.cloud.api.supplier.feign;

import com.jf.cloud.api.supplier.bo.SupplierDetailBO;
import com.jf.cloud.api.supplier.bo.SupplierSimpleBO;
import com.jf.cloud.api.supplier.vo.SupplierApiDetailVO;
import com.jf.cloud.api.supplier.vo.SupplierApiUserVO;
import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author zz
 * @date 2020/11/23
 */
@FeignClient(value = "jfcloud-supplier",contextId = "supplierDetail")
public interface SupplierDetailFeignClient {

    /**
     * 根据供应商id获取供应商店铺信息
     * @param supplierId 供应商id
     * @return 供应商店铺信息
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/getSupplierBySupplierId")
    ServerResponseEntity<SupplierDetailBO> getSupplierBySupplierId(@RequestParam("supplierId") Long supplierId);

    /**
     * 根据手机号获取已注册店铺的数量
     * @param mobile 手机号
     * @return 数量
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/countByMobile")
    ServerResponseEntity<Integer> countByMobile(@RequestParam("mobile") String mobile);

    /**
     * 根据供应商id列表， 获取供应商店铺列表信息
     * @param supplierIds 供应商id列表
     * @return 供应商店铺列表信息
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/listBySupplierIds")
    ServerResponseEntity<List<SupplierApiDetailVO>> listBySupplierIds(@RequestParam("supplierIds") List<Long> supplierIds);

    /**
     * 获取店铺工厂信息及扩展信息
     * @param supplierId
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/getSupplierExtension")
    ServerResponseEntity<SupplierDetailBO> supplierExtensionData(@RequestParam("supplierId") Long supplierId);

    /**
     * 获取供应商店铺信息及扩展信息
     * @param supplierIds 供应商ids
     * @param supplierName 供应商名称
     * @return 供应商店铺信息列表
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/getSupplierDetailBySupplierIdAndSupplierName")
    ServerResponseEntity<List<SupplierApiDetailVO>> getSupplierDetailBySupplierIdAndSupplierName(@RequestParam("supplierIds") List<Long> supplierIds,
                                                                                                     @RequestParam(value = "supplierName",defaultValue = "") String supplierName);

    /**
     * 获取工厂店铺信息及扩展信息
     * @param supplierName 工厂店铺名称
     * @return 工厂店铺信息列表
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/getSupplierDetailBySupplierName")
    ServerResponseEntity<List<SupplierApiDetailVO>> getSupplierDetailBySupplierName(@RequestParam(value = "supplierName",defaultValue = "") String supplierName);

    /**
     * 根据参数获取店铺id列表
     * @param supplierSimpleBO
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/listSimple")
    ServerResponseEntity<List<SupplierSimpleBO>> listSimple(@RequestBody SupplierSimpleBO supplierSimpleBO);

    /**
     * 根据用户id获取用户信息
     * @param supplierUserId 用户id
     * @return 用户信息
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/getSupplierUserBySupplierUserId")
    ServerResponseEntity<SupplierApiUserVO> getSupplierUserBySupplierUserId(@RequestParam("supplierUserId") Long supplierUserId);

    /**
     * 根据店铺状态获取店铺id列表
     * @param supplierStatus
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/getSupplierIdsBySupplierStatus")
    ServerResponseEntity<List<Long>> getSupplierIdsBySupplierStatus(@RequestParam("supplierStatus") Integer supplierStatus);

    /**
     * 获取指定供应商信息
     * @param supplierIds
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/listSupplierDetailBySupplierIds")
    ServerResponseEntity<List<SupplierApiDetailVO>> listSupplierDetailBySupplierIds(@RequestBody  List<Long> supplierIds);

    /**
     * 根据店铺Id查询相关的供应商列表
     *
     * @param shopId
     * @param supplierName
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/supplierDetail/listSupplierByShopId")
    ServerResponseEntity<List<Long>> listSupplierIdByShopIdAndSupplierName(@RequestParam("shopId") Long shopId, @RequestParam(name = "supplierName", required = false)String supplierName);
}
